package org.video.mine.mycode;

import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.widget.ImageView;

import androidx.databinding.BindingAdapter;

import com.bumptech.glide.Glide;

public class ImageDataBindingAttar {
    @BindingAdapter(value = {"imageUrl","placeHolder","error"}, requireAll = false)
    public static void loadImage(ImageView imageView, String imageUrl, Drawable holderDrawable, Drawable errorDrawable){
        Glide.with(imageView.getContext())
                .load(imageUrl)
                .placeholder(holderDrawable)
                .error(errorDrawable)
                .into(imageView);
    }
}
